package com.woniuxy.dao;

import com.woniuxy.model.RoleModel;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 马世亮
 * @since 2022-02-15
 */
public interface RoleModelDao extends BaseMapper<RoleModel> {

    @Select("SELECT \n" +
            "  rm.role_id role_id,\n" +
            "  rm.role_name role_name\n" +
            "FROM role_model rm \n" +
            "JOIN account_role ar\n" +
            "ON rm.role_id = ar.role_id\n" +
            "WHERE ar.account_id = #{uid}")
    RoleModel getrole(@Param("uid") Integer uId);
}
